#ifndef VEC_EDGE_H_
#define VEC_EDGE_H_

#include "graph_support/GraphSupport.h"

namespace GRAPH_SUPPORT_NS
{
namespace impls
{

template <
		// TODO: may be VertexT or VertWrapT is not needed anymore
		typename VertexT,
		typename VertWrapT,
		typename EdgeAttributesT
		>
class Edge : public GRAPH_SUPPORT_NS::Graph::GrEdge
{
public:
	typedef EdgeAttributesT EdgeAttributes;

public:
	Edge( size_t begVid, size_t endVid, std::vector< VertWrapT > & wrapsStore, const EdgeAttributesT & attributes = EdgeAttributesT() )
		: begVid( begVid )
		, endVid( endVid )
		, wrapsStore( wrapsStore )
		, attributes( attributes )
	{
	}

public:
	const VertexT beg() const
	{
		const VertexT & begVertex = wrapsStore[begVid];
		return begVertex;
	}

	const VertexT end() const
	{
		const VertexT & endVertex = wrapsStore[endVid];
		return endVertex;
	}

	size_t begId()
	{
		return begVid;
	}

	size_t endId()
	{
		return endVid;
	}

public:
	EdgeAttributesT & getAttributes()
	{
		return attributes;
	}

private:
	/**
	 * doesn't owns pointers, VertWrapT * is used
	 * in order to use operator = ant constructor Edge( const Edge & )
	 */
	// TODO: decide: size_t of int
	size_t begVid;
	size_t endVid;
	const std::vector< VertWrapT > & wrapsStore;
	EdgeAttributesT attributes;
};

}
}

#endif /* VEC_EDGE_H_ */
